package com.my.chapter14;

import java.util.Arrays;
import java.util.List;

public class practice5 {
    static void rotate(Shape shape){
        if(shape instanceof Circle){
            return;
        }
        System.out.println(shape + "在旋转");
    }
    public static void main(String[] args) {
        List<Shape> shapes = Arrays.asList(
                new Circle(), new Square(), new Triangle(),
                new Rhomboid()
        );
        for(Shape shape:shapes){
            rotate(shape);
        }
    }
}
